//print function
function printOutput(){
	var output = '<div style="padding:20px 10px 20px 50px;">' + $('#out').val() + '<div>';
	var myWindow=window.open();
	myWindow.document.write(output);
	myWindow.print();
}


    



$(document).ready(function(){
    //submit the form for file uploading 
	 $('#submit_form_for_file').click(function(){

        $('#submit_file').submit();

    });
	 
    //copy function  
    $('#copying').zclip({
        path:'js/ZeroClipboard.swf',
        copy:function(){return $('#out').val();},
        afterCopy:function(){
            $('#out').select();
        }
   

    });

    //clear text function
    $('#clear_text').click(function(){

    	$("#out").val("");
    	$("#in").val("");

    });
    
    /*popup js */
    
    $("#modal_trigger").leanModal({top : 200, overlay : 0.6, closeButton: ".modal_close" });

    $(function(){
        // Calling Login Form
        $("#login_form").click(function(){
            $(".social_login").hide();
            $(".user_login").show();
            return false;
        });

        // Calling Register Form
        $("#register_form").click(function(){
            $(".social_login").hide();
            $(".user_register").show();
            $(".header_title").text('Тіркелу');
            return false;
        });

        // Going back to Social Forms
        $(".back_btn").click(function(){
            $(".user_login").hide();
            $(".user_register").hide();
            $(".social_login").show();
            $(".header_title").text('Кіру');
            return false;
        });

    })

    // popup for uploading
    $("#upload_trigger").leanModal({top : 200, overlay : 0.6, closeButton: ".modal_close" }); 
    	

});
